package com.zh.work.entity.branch;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * code is far away from bug with the animal protecting
 * ┏┓　　　┏┓
 * ┏┛┻━━━┛┻┓
 * ┃　　　　　　　┃
 * ┃　　　━　　　┃
 * ┃　┳┛　┗┳　┃
 * ┃　　　　　　　┃
 * ┃　　　┻　　　┃
 * ┃　　　　　　　┃
 * ┗━┓　　　┏━┛
 * 　　┃　　　┃神兽保佑
 * 　　┃　　　┃代码无BUG！
 * 　　┃　　　┗━━━┓
 * 　　┃　　　　　　　┣┓
 * 　　┃　　　　　　　┏┛
 * 　　┗┓┓┏━┳┓┏┛
 * 　　　┃┫┫　┃┫┫
 * 　　　┗┻┛　┗┻┛
 *
 * @Description: 公众号信息实体类
 * @Author: Li.HuiNeng
 * @Create in: 2019/8/24
 * @Version: 1.0.1
 */
@ApiModel(value = "公众号信息实体类",description = "公众号信息实体类")
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("offical_info")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OfficialEntity extends Model<OfficialEntity> {
    private static final long serialVersionUID = -6063084946436234154L;

    @ApiModelProperty(value = "主键", name = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "逻辑删除字段", name = "deleted")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty(value = "app_id", name = "appId")
    @TableField(value = "app_id")
    private String appId;

    @ApiModelProperty(value = "APP密钥", name = "appKey")
    @TableField(value = "app_key")
    private String appKey;

    @ApiModelProperty(value = "公众号名称", name = "appName")
    @TableField(value = "app_name")
    private String appName;

    @ApiModelProperty(value = "ACCESS_TOKEN", name = "accessToken")
    @TableField(value = "access_token")
    private String accessToken;

    @ApiModelProperty(value = "上次更新时间(yyyyMMddHH)", name = "last_token_time")
    @TableField(value = "last_token_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastTokenTime;

}
